// subpkg_user/pages/profile/index.js
const app = getApp()
Page({
  data:{
    nickname:wx.getStorageSync('nickname'),
    avatarUrl:wx.getStorageSync('avatarUrl')
  },
  getNickName(ev){
    console.log(ev.detail.value);
    this.setData({
      nickname: ev.detail.value
    })
    wx.setStorageSync('nickname', ev.detail.value)
    app.nickname = ev.detail.value
  },
  getAvatar(ev){
    this.setData({
      avatarUrl: ev.detail.avatarUrl
    })
    wx.setStorageSync('avatarUrl', ev.detail.avatarUrl)
    app.avatarUrl = ev.detail.avatarUrl
  }
})